import { ref } from 'vue'
import { useRoute } from 'vue-router'
import UseLocalStorage from './UseLocalStorage'

// 接口

function Usemy () {
  // 获取本地存储的id
  const { localStorageId } = UseLocalStorage()
  // 获取route
  const route = useRoute()
  // 获取用户id
  let userID = ref<any>('')
  
  if(route.query.userId === void 0) {
    userID.value = localStorageId
  } else {
    userID.value = route.query.userId
  }

  return {
    userID
  }
}

export default Usemy